/*
 * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package cn.matezk.dms.things.model.req;

import cn.matezk.dms.things.model.entity.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import top.continew.starter.extension.crud.model.req.BaseReq;

import java.io.Serial;

/**
 * 创建或修改产品参数参数
 *
 * @author 程道林
 * @since 2025/08/21 17:46
 */
@Data
@Schema(description = "创建或修改设备事件参数")
public class ProductReq extends BaseReq {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 产品ID
     */
    @Schema(description = "产品ID")
    private String productId;

    /**
     * 产品名称
     */
    @Schema(description = "产品名称")
    @Length(max = 30, message = "产品名称长度不能超过 {max} 个字符")
    private String productName;

    /**
     * 设备类型
     */
    @Schema(description = "设备类型")
    private String deviceType;

    /**
     * 产品密钥
     */
    @Schema(description = "产品密钥")
    private String productSecret;

    /**
     * 产品描述
     */
    @Schema(description = "产品描述")
    @Length(max = 100, message = "产品描述长度不能超过 {max} 个字符")
    private String productDesc;

    /**
     * 产品型号
     */
    @Schema(description = "产品型号")
    private String productModel;

    /**
     * 通讯协议
     */
    @Schema(description = "通讯协议")
    private String protocol;

    /**
     * 联网方式
     */
    @Schema(description = "联网方式")
    private String network;

    /**
     * 动态注册
     */
    @Schema(description = "自动创建设备")
    private Boolean register;

    /**
     * 自动创建设备
     */
    @Schema(description = "自动创建设备")
    private Boolean autoCreate;

    /**
     * 平台
     */
    @Schema(description = "平台")
    private String platform;

    /**
     * 状态
     */
    @Schema(description = "状态")
    private String status;

    /**
     * 图标
     */
    @Schema(description = "图标")
    @Length(max = 120, message = "产品图标长度不能超过 {max} 个字符")
    private String icon;

    /**
     * 物模型
     */
    @Schema(description = "物模型")
    private Model model;

    /**
     * 使用范围 1:小程序 2:PC 3:小程序和PC
     */
    @Schema(description = "使用范围")
    private Integer scope;
}